package com.bestcem.xm.common.core.sign.grpc.core;

import com.bestcem.xm.common.core.sign.grpc.interceptor.GrpcClientInterceptor;
import com.bestcem.xm.common.core.sign.grpc.interceptor.GrpcInterceptor;
import io.grpc.ClientInterceptor;
import io.grpc.ServerInterceptor;
import net.devh.boot.grpc.client.interceptor.GrpcGlobalClientInterceptor;
import net.devh.boot.grpc.server.interceptor.GrpcGlobalServerInterceptor;
import org.springframework.context.annotation.Configuration;

/**
 * @author sh.pei <sh.pei@idiaoyan.com>
 * @version v1.0
 * @date 2021/7/14 11:21
 */
@Configuration
public class GrpcInterceptorConfiguration {

    @GrpcGlobalServerInterceptor
    public ServerInterceptor serverInterceptor() {
        return new GrpcInterceptor();
    }

    @GrpcGlobalClientInterceptor
    public ClientInterceptor clientInterceptor() {
        return new GrpcClientInterceptor();
    }
}
